﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style TargetType="Label">
        <Setter Property="Margin" Value="11,11,0,0"/>
    </Style>

    <Style TargetType="Button">
        <Setter Property="MinWidth" Value="75"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="Margin" Value="11,11,0,0"/>
    </Style>

    <Style x:Key="HeaderLabel" TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
        <Setter Property="FontWeight" Value="SemiBold"/>
    </Style>
    
    <Style x:Key="RecentDocumentRibbonButton" TargetType="{x:Type RibbonButton}">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="5,2,5,2"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border x:Name="mainBorder" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                        <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" TextTrimming="CharacterEllipsis"/>
                    </Border>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="mainBorder" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).MouseOverBackground}" />
                            <Setter TargetName="mainBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).MouseOverBorderBrush}" />
                        </Trigger>
                        <Trigger Property="ToggleButton.IsPressed" Value="True">
                            <Setter TargetName="mainBorder" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).PressedBackground}" />
                            <Setter TargetName="mainBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).PressedBorderBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PinRibbonToggleButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border x:Name="mainBorder" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                        <Image Source="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" Width="16" Height="16"/>
                    </Border>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="mainBorder" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).MouseOverBackground}" />
                            <Setter TargetName="mainBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).MouseOverBorderBrush}" />
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                            <Setter TargetName="mainBorder" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).CheckedBackground}" />
                            <Setter TargetName="mainBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).CheckedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="ToggleButton.IsPressed" Value="True">
                            <Setter TargetName="mainBorder" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).PressedBackground}" />
                            <Setter TargetName="mainBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(RibbonControlService.Ribbon).PressedBorderBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>